package com.example.demo.timer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.example.demo.producer.SyncProducer;

import lombok.extern.slf4j.Slf4j;


@Slf4j
@Component
@Configuration
@EnableScheduling
public class NextDayTask {

	@Autowired
	SyncProducer syncProducer;
    
	//每天5点15分执行一次
    @Scheduled(cron = "0 15 17 * * ?")
    public void testSend() throws InterruptedException {
    	log.info("定时器！");
    	syncProducer.sysBeDuty();
    }
}
